//##LICENSE##
/*
 * See License.txt in the source folder for the license.
 */
//##END_LICENSE##

package org.gidoo.owl2.viewer;

import org.apache.wicket.PageParameters;
import org.gidoo.owl2.viewer.panels.ResultPanel;
import org.gidoo.owl2.viewer.panels.SearchPanel;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.FeedbackPanel;

/**
 *
 * @author Thomas Krause
 */
public class SearchPage extends WebPage
{
  public SearchPage(PageParameters params)
  {
    super(params);
    
    add(new FeedbackPanel("feedback"));

    add(new Label("title", "Search result"));
    
    PageParameters p = getPageParameters();
    if(p != null)
    {
      String searchTerm = p.getString("search", null);
      long id = p.getAsLong("id", -1);


      add(new SearchPanel("panelSearch", id));

      add(new ResultPanel("panelResult", id, searchTerm));
    }
    else
    {
      add(new ResultPanel("panelResult", -1, null));
    }
  }
}
